-- BP 7.1.6 content: Package syschar: 3 persistence-version: 7.1.6

INSERT INTO EP_PKG
	VALUES ("77f07e43-a759-4f56-8884-a5892b20e6d0",
	"00000000-0000-0000-0000-000000000000",
	"c8b88000-dddc-4206-8410-2f69b8f86b67",
	'Type Model Bridges',
	'Incoming bridges for creating model elements of the Type subsystem as metamodel 
instances.',
	0);
INSERT INTO GD_MD
	VALUES ("e3dbf175-84d4-48f9-97c7-a8216133dc06",
	112,
	"77f07e43-a759-4f56-8884-a5892b20e6d0",
	108,
	0,
	0,
	1,
	1,
	1,
	12,
	1,
	0,
	0,
	0,
	0,
	0,
	'4.1.17',
	'shlaer-mellor-metamodel::metamodel::Shlaer-Mellor Metamodel::Incoming Bridges::Type Model Bridges');
INSERT INTO DIM_DIA
	VALUES ("e3dbf175-84d4-48f9-97c7-a8216133dc06",
	'',
	1.000000,
	0.000000,
	0.000000,
	"00000000-0000-0000-0000-000000000000");
INSERT INTO S_SYNC
	VALUES ("9eda14e5-82ea-4ef7-858d-59a9e0e9a655",
	"00000000-0000-0000-0000-000000000000",
	'addEnumerationValue',
	'Add an enumeration value to an existing enumeration type.
    This bridge must be called for each enumeration value. Every enumeration 
type requires at least one enumeration.',
	'result = creationResult_t::SUCCESS;
if ("" == param.name)
  result = creationResult_t::FAILURE;
  LOG::LogFailure( message:"Create object failed due to invalid object name, " + param.name + "." );
else
  select any domain from instances of MDOM where selected.name == param.domain;
  if (empty domain)
    result = creationResult_t::FAILURE;
    LOG::LogFailure( message:"Domain, " + param.domain + ", not instantiated!" );
  else
    select any enum from instances of ENUM;
    if (empty enum)
      result = creationResult_t::FAILURE;
      LOG::LogFailure( message:"Enumeration type not instantiated!" );
    else
      select any enud from instances of ENUD where selected.name == param.enumeration;
      if (not empty enud)
        select any enuv related by enud->ENUV[R420] where selected.name == param.name;
        if (not empty enuv)
          result = creationResult_t::DUPLICATE;
          LOG::LogInfo( message:"Enumeration value, " + param.name + ", already assigned to enumeration, " + param.enumeration + "." );
        end if;
      else
        create object instance enud of ENUD;
      end if;
      if ( creationResult_t::SUCCESS == result )
        relate enud to enum across R416;
        create object instance enuv of ENUV;
        enuv.name = param.name;
        relate enuv to enud across R420;
        create object instance value of VAL;
        relate enuv to value across R629;
        create object instance dus of DUS;
        relate dus to value across R624;
        create object instance re of RE;
        relate dus to re across R514;
        select one type related by enum->CORE[R403]->TYPE[R401];
        relate type to dus across R625.''constrains'';
      end if;
    end if;
  end if;
end if;
',
	"ba5eda7a-def5-0000-0000-000000000000",
	1,
	'',
	0,
	0);
INSERT INTO S_SPARM
	VALUES ("185b5dd9-d42a-405d-9106-05d9203bd70e",
	"9eda14e5-82ea-4ef7-858d-59a9e0e9a655",
	'domain',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"00000000-0000-0000-0000-000000000000",
	'The modeled domain name.
');
INSERT INTO S_SPARM
	VALUES ("f7c297ed-0420-4882-b9d2-80fb6e106196",
	"9eda14e5-82ea-4ef7-858d-59a9e0e9a655",
	'name',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"185b5dd9-d42a-405d-9106-05d9203bd70e",
	'The name of the enumeration value.');
INSERT INTO S_SPARM
	VALUES ("dc19f255-1804-48f7-bb23-2ec58b0779d9",
	"9eda14e5-82ea-4ef7-858d-59a9e0e9a655",
	'enumeration',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"f7c297ed-0420-4882-b9d2-80fb6e106196",
	'The name of the enumeration to which the enumeration value is assigned. ');
INSERT INTO PE_PE
	VALUES ("9eda14e5-82ea-4ef7-858d-59a9e0e9a655",
	1,
	"77f07e43-a759-4f56-8884-a5892b20e6d0",
	"00000000-0000-0000-0000-000000000000",
	1);
INSERT INTO S_SYNC
	VALUES ("a1a84080-258f-48d8-9537-18523d496d30",
	"00000000-0000-0000-0000-000000000000",
	'createType',
	'Create a new user-defined type from a domain model to be verified against the 
Shlaer-Mellor metamodel. The only expected failure scenarios are duplication, 
and invalid parameters.',
	'result = creationResult_t::SUCCESS;
if ("" == param.name)
    result = creationResult_t::FAILURE;
    LOG::LogFailure( message:"Create type failed due to invalid type name, " + param.name + "." );
else
    select any domain from instances of DOM where selected.name == param.domain;
    if (empty domain)
        result = creationResult_t::FAILURE;
        LOG::LogFailure( message:"Domain not instantiated!" );
    else
        select any type from instances of TYPE where selected.name == param.name;
        if (not empty type)
            result = creationResult_t::DUPLICATE;
            LOG::LogInfo( message:"Duplicate type instantiation attempt!" );
        else
            generate DOMD1:create( name:param.name, coreType:param.coreType, domain:param.domain ) to DOMD creator;
        end if;
    end if;
end if;
return result;',
	"709da393-5976-4a6f-9ea6-b5c91ab9f7a4",
	1,
	'',
	0,
	0);
INSERT INTO S_SPARM
	VALUES ("873deaa3-a388-4a3b-b9fc-3f1f1b2365d8",
	"a1a84080-258f-48d8-9537-18523d496d30",
	'domain',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"00000000-0000-0000-0000-000000000000",
	'The modeled domain name.
');
INSERT INTO S_SPARM
	VALUES ("20d0713b-211f-4d8c-bbb8-a86ed4e8fded",
	"a1a84080-258f-48d8-9537-18523d496d30",
	'name',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"873deaa3-a388-4a3b-b9fc-3f1f1b2365d8",
	'The name of the user-defined data type for the modeled domain.');
INSERT INTO S_SPARM
	VALUES ("92f3108e-f91e-4367-ac78-bc1ddb0be1f9",
	"a1a84080-258f-48d8-9537-18523d496d30",
	'coreType',
	"0b1ed8bd-1715-4575-a6c6-77d9a368c4fc",
	0,
	'',
	"20d0713b-211f-4d8c-bbb8-a86ed4e8fded",
	'The metamodel core data type name associated with this user defined data type.');
INSERT INTO S_DT_PROXY
	VALUES ("0b1ed8bd-1715-4575-a6c6-77d9a368c4fc",
	"00000000-0000-0000-0000-000000000000",
	'data_t',
	'An enumeration of the core data types defined in the metamodel.',
	'',
	'../../../DataTypes/DataTypes.xtuml');
INSERT INTO PE_PE
	VALUES ("a1a84080-258f-48d8-9537-18523d496d30",
	1,
	"77f07e43-a759-4f56-8884-a5892b20e6d0",
	"00000000-0000-0000-0000-000000000000",
	1);
INSERT INTO S_DT_PROXY
	VALUES ("709da393-5976-4a6f-9ea6-b5c91ab9f7a4",
	"00000000-0000-0000-0000-000000000000",
	'creationResult_t',
	'The creation result type is used in conjunction with creating a Shlaer-Mellor 
domain model to verify it is compatible with the metamodel. The result 
enumerator directs the verifier toward further action.',
	'',
	'../../../DataTypes/DataTypes.xtuml');
INSERT INTO S_SYNC
	VALUES ("2d88458d-50cf-4182-94a6-31d9258e0653",
	"00000000-0000-0000-0000-000000000000",
	'createOperator',
	'Create an operator for a user-defined type that is not already part of the set 
of operators for its core type.',
	'result = creationResult_t::SUCCESS;
if ("" == param.name)
  result = creationResult_t::FAILURE;
  LOG::LogFailure( message:"Create operator failed due to invalid name, " + param.name);
else
  select any domain from instances of DOM where selected.name == param.domain;
  if (empty domain)
    result = creationResult_t::FAILURE;
    LOG::LogFailure( message:"Domain not instantiated!" );
  else
    select any type from instances of TYPE where selected.name == param.type;
    if (empty type)
      result = creationResult_t::FAILURE;
      LOG::LogFailure( message:"Type not instantiated!" );
    else
      select any type from instances of TYPE where selected.name == param.resultType;
      if (empty type)
        result = creationResult_t::FAILURE;
        LOG::LogFailure( message:"Result type not instantiated!" );
      else
        select any tyop from instances of TYOP where (selected.type_name == param.type) and (selected.operation_name == param.name) and (selected.result_type_name == param.resultType);
        if (not empty tyop)
          result = creationResult_t::DUPLICATE;
          LOG::LogFailure( message:"Duplication of operator, " + param.name + " , for type, " + param.type + "." );
        else
          generate TYOP_A1:create( type:param.type, name:param.name, symbol:param.symbol, result:param.resultType ) to TYOP class;
        end if;
      end if;
    end if;
  end if;
end if;
return result;
',
	"709da393-5976-4a6f-9ea6-b5c91ab9f7a4",
	1,
	'',
	0,
	0);
INSERT INTO S_SPARM
	VALUES ("712c7d9b-5428-4218-9318-5c39e007eeac",
	"2d88458d-50cf-4182-94a6-31d9258e0653",
	'domain',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"00000000-0000-0000-0000-000000000000",
	'The modeled domain name.
');
INSERT INTO S_SPARM
	VALUES ("ed7d8445-879d-4cfc-b09f-66ca3743a55f",
	"2d88458d-50cf-4182-94a6-31d9258e0653",
	'type',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"712c7d9b-5428-4218-9318-5c39e007eeac",
	'The name of the data type associated with this operation.
');
INSERT INTO S_SPARM
	VALUES ("c6702672-b4a5-46d2-a85a-70462ad51416",
	"2d88458d-50cf-4182-94a6-31d9258e0653",
	'name',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"ed7d8445-879d-4cfc-b09f-66ca3743a55f",
	'The name of the operation. e.g., "addition"');
INSERT INTO S_SPARM
	VALUES ("f0decabb-7b95-42ab-bb97-fd44f38625c0",
	"2d88458d-50cf-4182-94a6-31d9258e0653",
	'symbol',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"c6702672-b4a5-46d2-a85a-70462ad51416",
	'The symbolic name of the operation. e.g., "+"');
INSERT INTO S_SPARM
	VALUES ("3defcb95-9930-478e-969c-033980860aad",
	"2d88458d-50cf-4182-94a6-31d9258e0653",
	'resultType',
	"ba5eda7a-def5-0000-0000-000000000004",
	0,
	'',
	"f0decabb-7b95-42ab-bb97-fd44f38625c0",
	'The name of the data type that the result of the operation produces.');
INSERT INTO PE_PE
	VALUES ("2d88458d-50cf-4182-94a6-31d9258e0653",
	1,
	"77f07e43-a759-4f56-8884-a5892b20e6d0",
	"00000000-0000-0000-0000-000000000000",
	1);
INSERT INTO PE_PE
	VALUES ("77f07e43-a759-4f56-8884-a5892b20e6d0",
	1,
	"9ddf81e7-a28d-4e3c-b59b-ce104ef0f540",
	"00000000-0000-0000-0000-000000000000",
	7);
INSERT INTO EP_PKG_PROXY
	VALUES ("9ddf81e7-a28d-4e3c-b59b-ce104ef0f540",
	"00000000-0000-0000-0000-000000000000",
	"c8b88000-dddc-4206-8410-2f69b8f86b67",
	'Incoming Bridges',
	'Bridges into the metamodel domain.',
	0,
	'../Incoming Bridges.xtuml');
INSERT INTO S_SYS_PROXY
	VALUES ("c8b88000-dddc-4206-8410-2f69b8f86b67",
	'shlaer-mellor-metamodel',
	1,
	'../../../../shlaer-mellor-metamodel.xtuml');
